package com.ruoyi.point.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.point.mapper.PointRuleMapper;
import com.ruoyi.point.domain.PointRule;
import com.ruoyi.point.service.IPointRuleService;

/**
 * 积分规则Service业务层处理
 * 
 * @author hy
 * @date 2025-08-12
 */
@Service
public class PointRuleServiceImpl implements IPointRuleService 
{
    @Autowired
    private PointRuleMapper pointRuleMapper;

    /**
     * 查询积分规则
     * 
     * @param id 积分规则主键
     * @return 积分规则
     */
    @Override
    public PointRule selectPointRuleById(Integer id)
    {
        return pointRuleMapper.selectPointRuleById(id);
    }

    /**
     * 查询积分规则列表
     * 
     * @param pointRule 积分规则
     * @return 积分规则
     */
    @Override
    public List<PointRule> selectPointRuleList(PointRule pointRule)
    {
        return pointRuleMapper.selectPointRuleList(pointRule);
    }

    /**
     * 新增积分规则
     * 
     * @param pointRule 积分规则
     * @return 结果
     */
    @Override
    public int insertPointRule(PointRule pointRule)
    {
        pointRule.setCreateTime(DateUtils.getNowDate());
        return pointRuleMapper.insertPointRule(pointRule);
    }

    /**
     * 修改积分规则
     * 
     * @param pointRule 积分规则
     * @return 结果
     */
    @Override
    public int updatePointRule(PointRule pointRule)
    {
        pointRule.setUpdateTime(DateUtils.getNowDate());
        return pointRuleMapper.updatePointRule(pointRule);
    }

    /**
     * 批量删除积分规则
     * 
     * @param ids 需要删除的积分规则主键
     * @return 结果
     */
    @Override
    public int deletePointRuleByIds(Integer[] ids)
    {
        return pointRuleMapper.deletePointRuleByIds(ids);
    }

    /**
     * 删除积分规则信息
     * 
     * @param id 积分规则主键
     * @return 结果
     */
    @Override
    public int deletePointRuleById(Integer id)
    {
        return pointRuleMapper.deletePointRuleById(id);
    }
}
